import { request } from '@/utils/request';
/**
 * @description 获取字典列表
 * @returns
 */
export function getDictList(data) {
  return request({
    url: '/api/dicts/dictDataList',
    method: 'post',
    data,
  });
}

/**
 * @description 删除字典
 * @returns
 */
export function deleteDict(data: any) {
  return request(
    {
      url: '/api/dicts/deleteDict',
      method: 'post',
      data,
    },
    {
      successMsg: '删除成功',
    },
  );
}

/**
 * @description 创建字典
 * @returns
 */
export function createDict(data: API.AddDictParams) {
  return request({
    url: '/api/dicts/addDict',
    method: 'post',
    data,
  });
}

// 更新字典
export function editDict(data: API.UpdateDictParams) {
  return request({
    url: '/api/dicts/updateDict',
    method: 'post',
    data,
  });
}
